import com.callback.CallbackListener;
import com.callback.CallbackService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class CallbackConsumer {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:consumer.xml");
        context.start();

        CallbackService callbackService = (CallbackService) context.getBean("callbackService");

        callbackService.addListener("http://10.20.160.198/wiki/display/dubbo/foo.bar", msg -> System.out.println("callback1:" + msg));
    }
}
